<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
<meta name="generator" content="Doxygen 1.8.5"/>
<title>xilskey: xilskey_eps.c File Reference</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="dynsections.js"></script>
<link href="navtree.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="resize.js"></script>
<script type="text/javascript" src="navtree.js"></script>
<script type="text/javascript">
  $(document).ready(initResizable);
  $(window).load(resizeHeight);
</script>
<link href="doxygen.css" rel="stylesheet" type="text/css" />
<link href="HTML_custom.css" rel="stylesheet" type="text/css"/>
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
 <tbody>
 <tr style="height: 56px;">
  <td id="projectlogo"><img alt="Logo" src="xlogo_bg.png"/></td>
  <td style="padding-left: 0.5em;">
   <div id="projectname">xilskey
   </div>
   <div id="projectbrief">Vitis Drivers API Documentation</div>
  </td>
 </tr>
 </tbody>
</table>
</div>
<!-- end header part -->
<!-- Generated by Doxygen 1.8.5 -->
  <div id="navrow1" class="tabs">
    <ul class="tablist">
      <li><a href="index.html"><span>Overview</span></a></li>
      <li><a href="annotated.html"><span>Data&#160;Structures</span></a></li>
      <li><a href="globals.html"><span>APIs</span></a></li>
      <li><a href="files.html"><span>File&#160;List</span></a></li>
    </ul>
  </div>
</div><!-- top -->
<div id="side-nav" class="ui-resizable side-nav-resizable">
  <div id="nav-tree">
    <div id="nav-tree-contents">
      <div id="nav-sync" class="sync"></div>
    </div>
  </div>
  <div id="splitbar" style="-moz-user-select:none;"
       class="ui-resizable-handle">
  </div>
</div>
<script type="text/javascript">
$(document).ready(function(){initNavTree('xilskey__eps_8c.html','');});
</script>
<div id="doc-content">
<div class="header">
  <div class="summary">
<a href="#func-members">Functions</a> &#124;
<a href="#var-members">Variables</a>  </div>
  <div class="headertitle">
<div class="title">xilskey_eps.c File Reference</div>  </div>
</div><!--header-->
<div class="contents">
<a name="details" id="details"></a><h2 class="groupheader">Overview</h2>
<div class="textblock"><p>This file contains the PS eFUSE API's to program/read the eFUSE array. </p>
<dl class="section note"><dt>Note</dt><dd>None.</dd></dl>
<p>MODIFICATION HISTORY:</p>
<p>Ver Who Date Changes </p>
<hr/>
<p> 1.00a rpoolla 04/26/13 First release 1.02a hk 10/28/13 Added API to read status register.PR# 735957 2.00 hk 23/01/14 Changed PS efuse error codes for voltage out of range. 2.1 sk 04/03/15 Initialized RSAKeyReadback with Zeros CR# 829723. 3.00 vns 31/07/15 Removed redundant code to initialise timer. 4.00 vns 09/10/15 Added DFT control bits programming fecility for eFuse PS on Zynq. PR#862778 Added Conditional compilation to support Zynq Mp also. 5.00 vns 27/01/16 Fixed array out of bounds error CR #931207 6.0 vns 29/06/16 Added Margin 2 read verification after programming every Zynq's eFUSE PS bit CR #953052. vns 07/17/16 Fixed CR# 954260, Modified XilSKey_EfusePs_Write API to program eFUSE protect bit after programming DFT bits 6.6 vns 06/06/18 Added doxygen tags 6.8 vns 08/29/19 Initialized Status variables 7.2 am 07/13/21 Fixed doxygen warnings</p>
</div><table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="func-members"></a>
Functions</h2></td></tr>
<tr class="memitem:ga63c6c25524196e392935e0c9c9e34825"><td class="memItemLeft" align="right" valign="top">u32&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__xilskey__zynq__efuse.html#ga63c6c25524196e392935e0c9c9e34825">XilSKey_EfusePs_Write</a> (XilSKey_EPs *InstancePtr)</td></tr>
<tr class="memdesc:ga63c6c25524196e392935e0c9c9e34825"><td class="mdescLeft">&#160;</td><td class="mdescRight">This function is used to write to the PS eFUSE.  <a href="group__xilskey__zynq__efuse.html#ga63c6c25524196e392935e0c9c9e34825">More...</a><br/></td></tr>
<tr class="separator:ga63c6c25524196e392935e0c9c9e34825"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:gaf4b1541decb6c6f85a71e95c6023e601"><td class="memItemLeft" align="right" valign="top">u32&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__xilskey__zynq__efuse.html#gaf4b1541decb6c6f85a71e95c6023e601">XilSKey_EfusePs_Read</a> (XilSKey_EPs *InstancePtr)</td></tr>
<tr class="memdesc:gaf4b1541decb6c6f85a71e95c6023e601"><td class="mdescLeft">&#160;</td><td class="mdescRight">This function is used to read the PS eFUSE.  <a href="group__xilskey__zynq__efuse.html#gaf4b1541decb6c6f85a71e95c6023e601">More...</a><br/></td></tr>
<tr class="separator:gaf4b1541decb6c6f85a71e95c6023e601"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a8de972831fdeea3f25a593ea7986899a"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="xilskey__eps_8c.html#a8de972831fdeea3f25a593ea7986899a">XilSKey_EfusePs_GenerateMatrixMap</a> (void)</td></tr>
<tr class="memdesc:a8de972831fdeea3f25a593ea7986899a"><td class="mdescLeft">&#160;</td><td class="mdescRight">This function is used to generate the matrix map of the G and H for hamming code (31,26).  <a href="#a8de972831fdeea3f25a593ea7986899a">More...</a><br/></td></tr>
<tr class="separator:a8de972831fdeea3f25a593ea7986899a"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:adf842c0bf8f3e7c5d5dcfc8e46f8cf77"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="xilskey__eps_8c.html#adf842c0bf8f3e7c5d5dcfc8e46f8cf77">XilSKey_EfusePs_EccEncode</a> (const u8 *InData, u8 *Ecc)</td></tr>
<tr class="memdesc:adf842c0bf8f3e7c5d5dcfc8e46f8cf77"><td class="mdescLeft">&#160;</td><td class="mdescRight">This function is used to encode the incoming data byte.  <a href="#adf842c0bf8f3e7c5d5dcfc8e46f8cf77">More...</a><br/></td></tr>
<tr class="separator:adf842c0bf8f3e7c5d5dcfc8e46f8cf77"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a0018fa32b6f940720182140986d422c6"><td class="memItemLeft" align="right" valign="top">u8&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="xilskey__eps_8c.html#a0018fa32b6f940720182140986d422c6">XilSKey_EfusePs_EccDecode</a> (const u8 *Corrupt, u8 *Syndrome)</td></tr>
<tr class="memdesc:a0018fa32b6f940720182140986d422c6"><td class="mdescLeft">&#160;</td><td class="mdescRight">This function is used to decode the incoming encoded byte.  <a href="#a0018fa32b6f940720182140986d422c6">More...</a><br/></td></tr>
<tr class="separator:a0018fa32b6f940720182140986d422c6"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a86aa3b42b03a38e86ae622b0338523cc"><td class="memItemLeft" align="right" valign="top">u32&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="xilskey__eps_8c.html#a86aa3b42b03a38e86ae622b0338523cc">XilSKey_EfusePs_ControllerConfig</a> (u8 CtrlMode, u32 RefClk, u8 ReadMode)</td></tr>
<tr class="memdesc:a86aa3b42b03a38e86ae622b0338523cc"><td class="mdescLeft">&#160;</td><td class="mdescRight">This function is used to set the controller mode, read mode along with the read and program strobe width values based on the reference clock.  <a href="#a86aa3b42b03a38e86ae622b0338523cc">More...</a><br/></td></tr>
<tr class="separator:a86aa3b42b03a38e86ae622b0338523cc"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:aa96506a89bc84dd4db81ce860cd63ef0"><td class="memItemLeft" align="right" valign="top">u8&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="xilskey__eps_8c.html#aa96506a89bc84dd4db81ce860cd63ef0">XilSKey_EfusePs_IsAddressXilRestricted</a> (u32 Addr)</td></tr>
<tr class="memdesc:aa96506a89bc84dd4db81ce860cd63ef0"><td class="mdescLeft">&#160;</td><td class="mdescRight">This function is used to check whether eFuse bit is xilinx reserved bit or not.  <a href="#aa96506a89bc84dd4db81ce860cd63ef0">More...</a><br/></td></tr>
<tr class="separator:aa96506a89bc84dd4db81ce860cd63ef0"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a445869d8f60f01261334c1022c4b08f5"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="xilskey__eps_8c.html#a445869d8f60f01261334c1022c4b08f5">XilSKey_EfusePs_ControllerSetReadWriteEnable</a> (u32 ReadWriteEnable)</td></tr>
<tr class="memdesc:a445869d8f60f01261334c1022c4b08f5"><td class="mdescLeft">&#160;</td><td class="mdescRight">This function is used to enable the read/write/program the eFUSE array.  <a href="#a445869d8f60f01261334c1022c4b08f5">More...</a><br/></td></tr>
<tr class="separator:a445869d8f60f01261334c1022c4b08f5"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a35d72d812bd2eedfe0fe1cf855819774"><td class="memItemLeft" align="right" valign="top">u32&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="xilskey__eps_8c.html#a35d72d812bd2eedfe0fe1cf855819774">XilSKey_EfusePs_ReadEfuseBit</a> (u32 Addr, u8 *Data)</td></tr>
<tr class="memdesc:a35d72d812bd2eedfe0fe1cf855819774"><td class="mdescLeft">&#160;</td><td class="mdescRight">This function is used to read the eFuse bit value.  <a href="#a35d72d812bd2eedfe0fe1cf855819774">More...</a><br/></td></tr>
<tr class="separator:a35d72d812bd2eedfe0fe1cf855819774"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a2c6ad78fcde90b22766572624ce2f236"><td class="memItemLeft" align="right" valign="top">u32&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="xilskey__eps_8c.html#a2c6ad78fcde90b22766572624ce2f236">XilSKey_EfusePs_WriteEfuseBit</a> (u32 Addr)</td></tr>
<tr class="memdesc:a2c6ad78fcde90b22766572624ce2f236"><td class="mdescLeft">&#160;</td><td class="mdescRight">This function is used to program the eFuse bit value.  <a href="#a2c6ad78fcde90b22766572624ce2f236">More...</a><br/></td></tr>
<tr class="separator:a2c6ad78fcde90b22766572624ce2f236"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:gae3fb5ac72380a5efddd99df27fde3c41"><td class="memItemLeft" align="right" valign="top">u32&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__xilskey__zynq__efuse.html#gae3fb5ac72380a5efddd99df27fde3c41">XilSKey_EfusePs_ReadStatus</a> (XilSKey_EPs *InstancePtr, u32 *StatusBits)</td></tr>
<tr class="memdesc:gae3fb5ac72380a5efddd99df27fde3c41"><td class="mdescLeft">&#160;</td><td class="mdescRight">This function is used to read the PS efuse status register.  <a href="group__xilskey__zynq__efuse.html#gae3fb5ac72380a5efddd99df27fde3c41">More...</a><br/></td></tr>
<tr class="separator:gae3fb5ac72380a5efddd99df27fde3c41"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table><table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="var-members"></a>
Variables</h2></td></tr>
<tr class="memitem:ae2b9f8f3a34a450d90b88bb79b29801f"><td class="memItemLeft" align="right" valign="top">u8&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="xilskey__eps_8c.html#ae2b9f8f3a34a450d90b88bb79b29801f">Matrix</a> [31][5]</td></tr>
<tr class="memdesc:ae2b9f8f3a34a450d90b88bb79b29801f"><td class="mdescLeft">&#160;</td><td class="mdescRight">PS eFUSE Matrix.  <a href="#ae2b9f8f3a34a450d90b88bb79b29801f">More...</a><br/></td></tr>
<tr class="separator:ae2b9f8f3a34a450d90b88bb79b29801f"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a7f051e409a483c56b42c3112c53f2b46"><td class="memItemLeft" align="right" valign="top">u8&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="xilskey__eps_8c.html#a7f051e409a483c56b42c3112c53f2b46">ErrorCodeIndex</a> [32]</td></tr>
<tr class="memdesc:a7f051e409a483c56b42c3112c53f2b46"><td class="mdescLeft">&#160;</td><td class="mdescRight">Error Code Array.  <a href="#a7f051e409a483c56b42c3112c53f2b46">More...</a><br/></td></tr>
<tr class="separator:a7f051e409a483c56b42c3112c53f2b46"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table>
<h2 class="groupheader">Function Documentation</h2>
<a class="anchor" id="a86aa3b42b03a38e86ae622b0338523cc"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">u32 XilSKey_EfusePs_ControllerConfig </td>
          <td>(</td>
          <td class="paramtype">u8&#160;</td>
          <td class="paramname"><em>CtrlMode</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">u32&#160;</td>
          <td class="paramname"><em>RefClk</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">u8&#160;</td>
          <td class="paramname"><em>ReadMode</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>This function is used to set the controller mode, read mode along with the read and program strobe width values based on the reference clock. </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">CtrlMode</td><td>is the mode of the controller<ul>
<li>XSK_EFUSEPS_REDUNDANCY_MODE</li>
<li>XSK_EFUSEPS_SINGLE_MODE</li>
</ul>
</td></tr>
    <tr><td class="paramname">RefClk</td><td>is the CPU 1x reference clock frequency. Clock frequency can be between 20MHz to 100MHz specified in Hz</td></tr>
    <tr><td class="paramname">ReadMode</td><td>is the read mode of the controller<ul>
<li>XSK_EFUSEPS_READ_MODE_NORMAL</li>
<li>XSK_EFUSEPS_READ_MODE_MARGIN_1</li>
<li>XSK_EFUSEPS_READ_MODE_MARGIN_2</li>
</ul>
</td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd><ul>
<li>XST_SUCCESS no errors occurred.</li>
</ul>
</dd></dl>
<ul>
<li>an error when controller mode is not supported</li>
<li>an error when reference clock is not supported</li>
<li>an error when read mode is not supported</li>
</ul>
<p>Test Cases: Check single mode in CFG Reg Check redundancy mode in CFG Reg Check strobe width values for write mode Check strobe width values for various read mode Check Normal Read mode setting in CFG Reg Check Margin 1 Read mode setting in CFG Reg Check Margin 2 Read mode setting in CFG Reg Boundary Conditions </p>
<p>Check the parameters Mode can be Single or Redundancy mode</p>
<p>Ref Clock should be between 20MHz - 60MHz</p>
<p>3 read modes are supported</p>
<p>Set the controller mode</p>
<p>Set the controller read mode</p>
<p>Program the Strobe width values for read and write 12us is required for write and 150ns is required for read PGM_STBW = ceiling(12us/ref_clk period) RD_STBW = ceiling(150ns/ref_clk period)</p>

<p>References <a class="el" href="xilskey__epshw_8h.html#a181241481bae878db9c1b8bc45eebd3d">XSK_EFUSEPS_CONFIG_REG</a>, <a class="el" href="xilskey__epshw_8h.html#ad585dc497a89d100b768fd0890aa2101">XSK_EFUSEPS_CONFIG_TSU_H_A</a>, <a class="el" href="group__xilskey__psefuse__error__codes.html#gga35d67e0a9db73e1fa64262f5eb8f9d6aa12fc3f5163ee9e27300002aba72c317e">XSK_EFUSEPS_ERROR_CONTROLLER_MODE</a>, <a class="el" href="group__xilskey__psefuse__error__codes.html#gga35d67e0a9db73e1fa64262f5eb8f9d6aa275d0d46da578a5f1e11e78fd31fcbc1">XSK_EFUSEPS_ERROR_READ_MODE</a>, <a class="el" href="group__xilskey__psefuse__error__codes.html#gga35d67e0a9db73e1fa64262f5eb8f9d6aaa657a41e407f120d32c5a4c92337c0d1">XSK_EFUSEPS_ERROR_REF_CLOCK</a>, <a class="el" href="xilskey__epshw_8h.html#a4d7fe5bd7667d9a57c238328f343d95c">XSK_EFUSEPS_PGM_STBW_REG</a>, <a class="el" href="xilskey__epshw_8h.html#a28a3e32054644f36176a139ba4fff520">XSK_EFUSEPS_PRGM_STROBE_WIDTH</a>, <a class="el" href="xilskey__epshw_8h.html#a9383ce46dbabb7c855569ef88ed73dc6">XSK_EFUSEPS_RD_STBW_REG</a>, <a class="el" href="xilskey__epshw_8h.html#a576c8c9ba3aa6a1246f498bc9f6ed60c">XSK_EFUSEPS_RD_STROBE_WIDTH</a>, <a class="el" href="xilskey__epshw_8h.html#a1926299738dd5272aaddea96259bffb0">XSK_EFUSEPS_REFCLK_LOW_FREQ</a>, and <a class="el" href="xilskey__epshw_8h.html#ab89168a190f2b176fc52aa119fbfd4bb">XSK_EFUSEPS_SINGLE_MODE</a>.</p>

<p>Referenced by <a class="el" href="group__xilskey__zynq__efuse.html#gaf4b1541decb6c6f85a71e95c6023e601">XilSKey_EfusePs_Read()</a>, and <a class="el" href="group__xilskey__zynq__efuse.html#ga63c6c25524196e392935e0c9c9e34825">XilSKey_EfusePs_Write()</a>.</p>

</div>
</div>
<a class="anchor" id="a445869d8f60f01261334c1022c4b08f5"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void XilSKey_EfusePs_ControllerSetReadWriteEnable </td>
          <td>(</td>
          <td class="paramtype">u32&#160;</td>
          <td class="paramname"><em>ReadWriteEnable</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>This function is used to enable the read/write/program the eFUSE array. </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">ReadWriteEnable</td><td>0x1 - Enable programming 0x2 - Enable read 0x4 - Enable write </td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd></dd></dl>
<p>Test Cases </p>
<p>Reset the values Disable programming Disable reading Disable writing</p>

<p>References <a class="el" href="xilskey__epshw_8h.html#a1c34f551c39236943d36103cb150353b">XSK_EFUSEPS_CONTROL_PS_EN</a>, <a class="el" href="xilskey__epshw_8h.html#a634af4b7edb7109523e14d841c4ac283">XSK_EFUSEPS_CONTROL_RD_DIS</a>, <a class="el" href="xilskey__epshw_8h.html#a37aa46e53d68f6c77c5e3d6f9a6943aa">XSK_EFUSEPS_CONTROL_REG</a>, <a class="el" href="xilskey__epshw_8h.html#a9c6d0eb879aee49e3109cba85d60a5ff">XSK_EFUSEPS_CONTROL_WR_DIS</a>, and <a class="el" href="xilskey__epshw_8h.html#a8b6db89bcacd73a511cfc74cd117d058">XSK_EFUSEPS_ENABLE_PROGRAMMING</a>.</p>

<p>Referenced by <a class="el" href="group__xilskey__zynq__efuse.html#gaf4b1541decb6c6f85a71e95c6023e601">XilSKey_EfusePs_Read()</a>, and <a class="el" href="group__xilskey__zynq__efuse.html#ga63c6c25524196e392935e0c9c9e34825">XilSKey_EfusePs_Write()</a>.</p>

</div>
</div>
<a class="anchor" id="a0018fa32b6f940720182140986d422c6"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">u8 XilSKey_EfusePs_EccDecode </td>
          <td>(</td>
          <td class="paramtype">const u8 *&#160;</td>
          <td class="paramname"><em>Corrupt</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">u8 *&#160;</td>
          <td class="paramname"><em>Syndrome</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>This function is used to decode the incoming encoded byte. </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">Corrupt</td><td>is the input encoded data. It has 26 bit data with 5 bit parity data</td></tr>
    <tr><td class="paramname">Syndrome</td><td>is the output updated with the parity error information.</td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>position of the error in the data byte</dd></dl>
<p>TDD Cases: Check the parameters Check the decode with out any error Check the decode with 1 bit error Check the decode with 2 bit error Check the decode for boundary cases Check for memory corruption </p>

<p>References <a class="el" href="xilskey__eps_8c.html#a7f051e409a483c56b42c3112c53f2b46">ErrorCodeIndex</a>, and <a class="el" href="xilskey__eps_8c.html#ae2b9f8f3a34a450d90b88bb79b29801f">Matrix</a>.</p>

</div>
</div>
<a class="anchor" id="adf842c0bf8f3e7c5d5dcfc8e46f8cf77"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void XilSKey_EfusePs_EccEncode </td>
          <td>(</td>
          <td class="paramtype">const u8 *&#160;</td>
          <td class="paramname"><em>InData</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">u8 *&#160;</td>
          <td class="paramname"><em>Ecc</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>This function is used to encode the incoming data byte. </p>
<p>It uses hamming (31,26) algorithm. 26 bits are encoded to 31 bits</p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">InData</td><td>is 26 bit input data with each bit represented in one byte</td></tr>
    <tr><td class="paramname">Ecc</td><td>is the 31 bit encoded data with each bit represented in one byte</td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>None</dd></dl>
<p>TDD Cases: Check the parameters Check the encoded data for different input data Check the input data for boundary cases Check for memory corruption </p>

<p>References <a class="el" href="xilskey__eps_8c.html#ae2b9f8f3a34a450d90b88bb79b29801f">Matrix</a>.</p>

</div>
</div>
<a class="anchor" id="a8de972831fdeea3f25a593ea7986899a"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void XilSKey_EfusePs_GenerateMatrixMap </td>
          <td>(</td>
          <td class="paramtype">void&#160;</td>
          <td class="paramname"></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>This function is used to generate the matrix map of the G and H for hamming code (31,26). </p>
<p>G is [31,5] and defined as [A|I], I is identity matrix of [5,5].</p>
<dl class="section return"><dt>Returns</dt><dd>None</dd></dl>
<p>TDD Cases: Check the generated matrix Check the memory corruption of the generated matrix </p>

<p>References <a class="el" href="xilskey__eps_8c.html#a7f051e409a483c56b42c3112c53f2b46">ErrorCodeIndex</a>, and <a class="el" href="xilskey__eps_8c.html#ae2b9f8f3a34a450d90b88bb79b29801f">Matrix</a>.</p>

</div>
</div>
<a class="anchor" id="aa96506a89bc84dd4db81ce860cd63ef0"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">u8 XilSKey_EfusePs_IsAddressXilRestricted </td>
          <td>(</td>
          <td class="paramtype">u32&#160;</td>
          <td class="paramname"><em>Addr</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>This function is used to check whether eFuse bit is xilinx reserved bit or not. </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">Addr</td><td>is the address of the eFuse bit.</td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd><ul>
<li>XST_SUCCESS if address corresponds to restricted eFuse bit.</li>
</ul>
</dd></dl>
<ul>
<li>XST_FAILURE is address corresponds to non-restricted eFuse bit.</li>
</ul>
<p>Test Cases: with different address values Boundary values for addr </p>
<p>Check for xilinx test bits</p>
<p>Check for xilinx reserved bits</p>

<p>References <a class="el" href="xilskey__epshw_8h.html#ad902de733258e3dee29cba902a315d40">XSK_EFUSEPS_APB_TRIM_BITS_START_ADDR</a>, <a class="el" href="xilskey__epshw_8h.html#ac226f4af9d59902bb9415a7f38992090">XSK_EFUSEPS_APB_TRIM_BITS_START_ADDR_2ND_HALF</a>, <a class="el" href="xilskey__epshw_8h.html#a81347f7506085d433d18c529b7f8d6e6">XSK_EFUSEPS_APB_XILINX_RSVD_TEST_BIT_x20</a>, and <a class="el" href="xilskey__epshw_8h.html#a30a30145d45855d1976ec41ef8d3a664">XSK_EFUSEPS_APB_XILINX_RSVD_TEST_BIT_x23F</a>.</p>

<p>Referenced by <a class="el" href="xilskey__epshw_8h.html#a35d72d812bd2eedfe0fe1cf855819774">XilSKey_EfusePs_ReadEfuseBit()</a>, and <a class="el" href="xilskey__epshw_8h.html#a2c6ad78fcde90b22766572624ce2f236">XilSKey_EfusePs_WriteEfuseBit()</a>.</p>

</div>
</div>
<a class="anchor" id="a35d72d812bd2eedfe0fe1cf855819774"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">u32 XilSKey_EfusePs_ReadEfuseBit </td>
          <td>(</td>
          <td class="paramtype">u32&#160;</td>
          <td class="paramname"><em>Addr</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">u8 *&#160;</td>
          <td class="paramname"><em>Data</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>This function is used to read the eFuse bit value. </p>
<p>Before using this function set the controller mode and read mode as required. Also, strobe width values are to be set properly based on the reference clock for successful reading</p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">Addr</td><td>is the address of the eFuse bit.</td></tr>
    <tr><td class="paramname">Data</td><td>has the read eFuse value stored in it.</td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd><ul>
<li>XST_SUCCESS for successfully reading the value.</li>
</ul>
</dd></dl>
<ul>
<li>an error when addr is restricted</li>
</ul>
<p>Test Cases Read in Single mode Read in redundancy mode Read for restricted address Boundary Checks for address </p>

<p>References <a class="el" href="xilskey__eps_8c.html#aa96506a89bc84dd4db81ce860cd63ef0">XilSKey_EfusePs_IsAddressXilRestricted()</a>, and <a class="el" href="group__xilskey__psefuse__error__codes.html#gga35d67e0a9db73e1fa64262f5eb8f9d6aad0082f74347e4ad447374d6992e82e55">XSK_EFUSEPS_ERROR_ADDRESS_XIL_RESTRICTED</a>.</p>

</div>
</div>
<a class="anchor" id="a2c6ad78fcde90b22766572624ce2f236"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">u32 XilSKey_EfusePs_WriteEfuseBit </td>
          <td>(</td>
          <td class="paramtype">u32&#160;</td>
          <td class="paramname"><em>Addr</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>This function is used to program the eFuse bit value. </p>
<p>Before using this function set the controller mode and read mode as required. Also, strobe width values are to be set properly based on the reference clock for successful programming</p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">Addr</td><td>is the address of the eFuse bit.</td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd><ul>
<li>XST_SUCCESS after successful writing.</li>
</ul>
</dd></dl>
<ul>
<li>an error when addr is restricted</li>
</ul>
<p>Test Cases Write in Single mode Write in redundancy mode Write for restricted address Boundary Checks for address Strobe width are not proper (Check if it makes sense) </p>
<p>Check if Address is restricted</p>
<p>Send success when bit is already programmed</p>
<p>Providing 15us delay Timer takes 100ns as slice. 15us = 150 * 100ns</p>

<p>References <a class="el" href="xilskey__utils_8c.html#a2a71bd701b24852c007d5ebad8acc257">XilSKey_Efuse_IsTimerExpired()</a>, <a class="el" href="xilskey__utils_8c.html#ab2eaa24ca4b7d40aab0d75804d217616">XilSKey_Efuse_SetTimeOut()</a>, <a class="el" href="xilskey__eps_8c.html#aa96506a89bc84dd4db81ce860cd63ef0">XilSKey_EfusePs_IsAddressXilRestricted()</a>, and <a class="el" href="group__xilskey__psefuse__error__codes.html#gga35d67e0a9db73e1fa64262f5eb8f9d6aad0082f74347e4ad447374d6992e82e55">XSK_EFUSEPS_ERROR_ADDRESS_XIL_RESTRICTED</a>.</p>

</div>
</div>
<h2 class="groupheader">Variable Documentation</h2>
<a class="anchor" id="a7f051e409a483c56b42c3112c53f2b46"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">u8 ErrorCodeIndex[32]</td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Error Code Array. </p>

<p>Referenced by <a class="el" href="xilskey__epshw_8h.html#a0018fa32b6f940720182140986d422c6">XilSKey_EfusePs_EccDecode()</a>, and <a class="el" href="xilskey__epshw_8h.html#a8de972831fdeea3f25a593ea7986899a">XilSKey_EfusePs_GenerateMatrixMap()</a>.</p>

</div>
</div>
<a class="anchor" id="ae2b9f8f3a34a450d90b88bb79b29801f"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">u8 Matrix[31][5]</td>
        </tr>
      </table>
</div><div class="memdoc">

<p>PS eFUSE Matrix. </p>

<p>Referenced by <a class="el" href="xilskey__epshw_8h.html#a0018fa32b6f940720182140986d422c6">XilSKey_EfusePs_EccDecode()</a>, <a class="el" href="xilskey__epshw_8h.html#adf842c0bf8f3e7c5d5dcfc8e46f8cf77">XilSKey_EfusePs_EccEncode()</a>, and <a class="el" href="xilskey__epshw_8h.html#a8de972831fdeea3f25a593ea7986899a">XilSKey_EfusePs_GenerateMatrixMap()</a>.</p>

</div>
</div>
</div><!-- contents -->
</div><!-- doc-content -->
<div id="nav-path" class="navpath"><!-- id is needed for treeview function! -->
	<p class="footer">&copy; Copyright 2015-2022 Xilinx, Inc. All Rights Reserved.</p>
	<p class="footer">&copy; Copyright 2022-2023 Advanced Micro Devices, Inc. All Rights Reserved.</p>
</div>
</body>
</html>
